home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 31
/
Amiga Format CD31 (1998-09-02)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1998-10].iso
/
-coverdisks-
/
115a
/
ppt
/
rexx
/
falsecolour.prx
< prev
next >
Wrap
Text File
|
1998-07-29
|
2KB
|
82 lines
/*
This script turns the image into false colour. The idea is that
this contrasts color differences strongly and makes it easier to
spot details.
$Id: FalseColour.prx 1.2 1998/06/29 20:52:04 jj Exp jj $
*/
/*-------------------------------------------------------------------*/
/* I suggest you use this header as-is and add your own code below */
OPTIONS RESULTS
SIGNAL ON ERROR
IF ADDRESS() = REXX THEN DO
startedfromcli = 1
ADDRESS PPT
END
ELSE DO
startedfromcli = 0
ADDRESS PPT
END
RESULT = 'no result'
/*-------------------------------------------------------------------*/
PARSE ARG frame
IF DATATYPE(frame) ~= NUM THEN DO
RC = 10
RC2 = "No frame selected"
SIGNAL ERROR
END
FRAMEINFO frame STEM myinfo
/*
* There is not much point in making a falsecolour greyscale
*/
IF myinfo.COLORSPACE = "Greyscale" THEN DO
EXIT 0
END
/*
* Ask user.
*/
cyc.type=CYCLE
cyc.label="Direction"
cyc.labels="Red->Green->Blue|Blue->Green->Red"
PPT_TO_FRONT
ASKREQ '"Please select the direction of the falsecolour effect"' cyc
res = RESULT
/*
* Work according to the user's wishes
*/
IF res = 0 THEN DO
IF cyc.value = 0 THEN DO
PROCESS frame COLORMIX RED "0,0,1.0" GREEN "1.0,0,0" BLUE "0,1.0,0"
END
ELSE DO
PROCESS frame COLORMIX RED "0,1.0,0" GREEN "0,0,1.0" BLUE "1.0,0,0"
END
END
EXIT 0
/*-------------------------------------------------------------------*/
/* Again, keep this part intact. This is the error handler. */
ERROR :
returncode = RC
IF startedfromcli = 1 THEN DO
SAY 'ERROR ' returncode ' on line ' SIGL ': ' RC2
PPT_TO_BACK
END
ELSE
SHOWERROR '"'RC2'"' SIGL
EXIT returncode